package by.grsu.epam.service.entitiesservice.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import by.grsu.epam.dao.GenericDAO;
import by.grsu.epam.dao.entitiesdao.PayCardDAO;
import by.grsu.epam.domain.account.PayCard;
import by.grsu.epam.service.GenericServiceImpl;
import by.grsu.epam.service.entitiesservice.PayCardService;

@Service
public class PayCardSeviceImpl extends GenericServiceImpl<PayCard, Long> implements PayCardService {
	
	@Autowired
	private PayCardDAO payCardDAO;

	@Override
	public GenericDAO<PayCard, Long> getDAO() {
		return payCardDAO;
	}

	@Override
	@Transactional
	public List<PayCard> findBySubscriberId(Long subscriberId) {
		return payCardDAO.findBySubscriberId(subscriberId);
	}

	@Override
	@Transactional
	public PayCard findBySerialNumber(String serial) {
		return payCardDAO.findBySerialNumber(serial);
	}
	
	
}
